package com.cykj.pos.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cykj.pos.domain.BizMerchantReceiver;
import com.cykj.pos.domain.dto.BizAccessTokenDTO;
import com.cykj.pos.domain.dto.BizAgentidAppkeyDTO;
import com.cykj.pos.domain.dto.BizMerchantReceiverDTO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商户下发收款者Mapper接口
 *
 * @author xxl
 * @date 2022-03-24
 */
public interface BizMerchantReceiverMapper extends BaseMapper<BizMerchantReceiver> {
    /**
     * 查询商户下发收款者
     * @param bizMerchantReceiver
     * @return
     */
    BizMerchantReceiver selectBizMerchantReceiverByMerchId(BizMerchantReceiver bizMerchantReceiver);

    /**
     * 更新收款者状态
     * @param bizMerchantReceiver
     */
    void updateBizMerchantReceiver(BizMerchantReceiver bizMerchantReceiver);

    Long selectUserId(String deal_no);

    /**
     * 查询收款者信息
     * @param userId
     * @return
     */
    BizMerchantReceiver selectBizMerchantReceiverByUserId(Long userId);

    BizAccessTokenDTO selectAcquireAccessToken();

    BizAgentidAppkeyDTO selectAgentidAppkey(@Param("userId") Long userId,@Param("deptId") Long deptId);

    Long selectSysDeptId(Long userId);

    BizAccessTokenDTO intserAcquireAccessToken(BizAccessTokenDTO bizAccessTokenDTO);

    int updateAcquireAccessToken(BizAccessTokenDTO bizAccessTokenDTO);

    Long intserReceiverService(BizMerchantReceiver bizMerchantReceiver);

    void updateReceiver(BizMerchantReceiver bizMerchantReceiver);

    Long selectMerchantReceiverMerchId(String idNumber);

    BizMerchantReceiver selectReceiverMerchIdcard(@Param("merchIdcard")String merchIdcard, @Param("merchId")Long merchId);

    String getStatus(String merchId);

    BizMerchantReceiver selectReceiverMerchIdcardIsSign(@Param("merchIdcard")String merchIdcard,
                                                        @Param("dftype")String dftype,
                                                        @Param("deptId")String deptId);

    BizMerchantReceiver selectBizMerchantReceiverByUserIdAndMerchId(@Param("merchId")String merchId,
                                                                    @Param("userId")String userId,
                                                                    @Param("deptId")String deptId);

    BizMerchantReceiver selectReceiverMerchIdcardIsSignLzf(@Param("merchIdcard")String merchIdcard);

    List<BizMerchantReceiver> getEachOne();

    BizMerchantReceiver bizMerchantReceiver(BizMerchantReceiverDTO bizMerchantReceiverDTO);
}
